<template>
    <div v-watermark="{ text: '开店审核' }">
        <el-row>{{ options.code_ }}</el-row>
        <el-row>
            <el-col :span="24" style="padding: 20px 10px">
                <el-descriptions title="用户信息" border>
                    <!-- <el-descriptions-item label="id">{{rowobj.application_id}}</el-descriptions-item> -->
                    <!-- <el-descriptions-item label="申请人名称">{{ rowobj.application_name }}</el-descriptions-item> -->
                    <el-descriptions-item label="申请单号">{{ rowobj.application_number }}</el-descriptions-item>
                    <el-descriptions-item label="申请人id">{{ rowobj.application_id }}</el-descriptions-item>
                    <el-descriptions-item label="申请内容">{{ rowobj.application_message }}</el-descriptions-item>
                    <el-descriptions-item label="备注">
                        <el-tag size="small">{{ rowobj.store_id }}</el-tag>
                    </el-descriptions-item>
                    <el-descriptions-item label="状态">{{ rowobj.auditing_status }}</el-descriptions-item>
                    <el-descriptions-item label="省">{{ rowobj.province }}</el-descriptions-item>
                    <el-descriptions-item label="市">{{ rowobj.city }}</el-descriptions-item>
                    <el-descriptions-item label="县">{{ rowobj.district }}</el-descriptions-item>
                </el-descriptions>

            </el-col>
        </el-row>
        <el-row>

            <el-col :span="8">
                <el-card :body-style="{ padding: '0px' }">
                    <el-image style="width: 200px;height: 200px" :src="rowobj.id_card_number_up_image"></el-image>
                    <div style="padding: 14px;">
                        <span>法人身份证正面</span>
                        <div class="bottom clearfix">
                            <!-- <time class="time">{{ currentDate }}</time> -->
                            <span>身份证号：{{ rowobj.id_card_number }}</span>
                        </div>
                    </div>
                </el-card>
                <!-- <div class="demo-image__placeholder">
                    <div class="block"
                        style="margin-bottom:20px; display: flex;align-items: center;justify-content: space-between;flex-direction: column;">
                        <span class="demonstration">法人身份证正面</span>

                        <span>身份证号：{{ rowobj.id_card_number }}</span>
                    </div>
                </div> -->

            </el-col>
            <el-col :span="8">
                <el-card :body-style="{ padding: '0px' }">
                    <!-- rowobj.id_card_number_down_image -->
                    <el-image style="width: 200px;height: 200px" :src="src"></el-image>
                    <div style="padding: 14px;">
                        <span>法人身份证反面</span>
                        <div class="bottom clearfix">
                            <!-- <time class="time">{{ currentDate }}</time> -->
                            <span>身份证号有效期：{{ rowobj.id_card_number_expiry_date }}</span>
                        </div>
                    </div>
                </el-card>

            </el-col>
            <el-col :span="8">
                <el-card :body-style="{ padding: '0px' }">
                    <!-- rowobj.id_card_number_down_image -->
                    <el-image style="width: 200px;height: 200px" :src="business_license_image"></el-image>
                    <div style="padding: 14px;">
                        <span>营业执照/经营许可证图像</span>
                        <div class="bottom clearfix">
                            <!-- <time class="time">{{ currentDate }}</time> -->
                            <span>营业执照有效期：{{ rowobj.business_license_expiry_date }}</span>
                        </div>
                    </div>
                </el-card>
            </el-col>

        </el-row>
        <el-row style="display: flex;justify-content: center;">
            <!-- <span>
                审核备注:
            </span> -->
            {{ application_view }}
            <textarea v-model="application_view" name="审核备注" id="" cols="100%" rows="10"
                placeholder="請輸入审核备注"></textarea>
        </el-row>
        <el-row type="flex" class="row-bg" justify="end" style="padding: 40px;">
            <el-button type="primary" @click="Auditing(0)">拒绝</el-button>
            <el-button type="primary" @click="Auditing(1)">通过</el-button>
        </el-row>

    </div>
</template>

<script>
import { Auditing_details, storeOpening } from "@/api/Auditing"
import { mapState } from 'vuex'
export default {
    data() {
        return {
            activeName: 'first',
            rowobj: null,
            options: {},
            src: 'https://cube.elemecdn.com/6/94/4d3ea53c084bad6931a56d5158a48jpeg.jpeg',
            application_view: ''
        }
    },
    computed: {
        ...mapState('user', { regionalData: "regionalData" })
    },
    methods: {
        handleClick(activeName) {
            this.activeName = activeName;
        },
        getInfo() {
            Auditing_details({
                application_number: this.options.application_number,
                code_: this.options.code_
            }).then(res => {
                this.rowobj = res.result[0]
            })
        },
        Auditing(operator_code) {
            // application_id:this.rowobj.application_id,
            //     application_name:this.rowobj.application_name,
            //     id_card_number:this.rowobj.id_card_number,
            //     id_card_number_expiry_date:this.rowobj.id_card_number_expiry_date,
            //     business_license_number:this.rowobj.business_license_number,
            //     business_license_expiry_date:this.rowobj.business_license_expiry_date,
            //     store_id:this.rowobj.store_id,
            //     store_name:this.rowobj.store_name,
            //     province:this.rowobj.province,
            //     city:this.rowobj.city,
            //     district:this.rowobj.district,
            //     bak:this.rowobj.bak,
            //     business_license_image:this.rowobj.business_license_image,
            //     id_card_number_down_image:this.rowobj.id_card_number_down_image,
            //     id_card_number_up_image:this.rowobj.id_card_number_up_image,
            let res = {
                operator: this.regionalData.name,
                operator_number: this.regionalData.admin_id,
                application_id: this.rowobj.application_id,
                application_number: this.rowobj.application_number,
                operator_code: operator_code,
                application_view: this.application_view
            }
            console.log(this.regionalData, '')
            storeOpening(res).then(res => {
                if (res.data.code == 16) {
                    this.$message({
                        message: res.data.string,
                        type: 'success'
                    });
                } else {
                    this.$message({
                        message: res.data.string,
                        type: 'error'
                    });
                }
            })
        }
    },
    mounted() {

        this.options = this.$route.query;
        console.log(this.options, 'red')
        this.getInfo()
    }
}
</script>

<style></style>